package com.zdl.interestingapp.utils

import android.app.Activity
import android.content.Context
import org.jetbrains.annotations.NotNull

/**
 * @author zdl
 * @date 2018/4/25 10:51
 * email zdl328465042@163.com
 * description
 */
object MyEscapeUtil {

    /**
     * 通过上下文获取activity
     * @param context 上下文
     * @return activity
     */
    fun getActivity(@NotNull context: Context): Activity {
        if (context is Activity) {
            return context
        }

        throw Exception("Unable to get Activity")
    }
}